<!--
 * @Description:: 请补充填写
 * @Version: 1.0
 * @Author: 小白
 * @Date: 2025-11-10 16:20:56
 * @LastEditors: 小白
 * @LastEditTime: 2025-11-10 16:42:38
 * @FilePath: \jzadmin\src\views\vip_management\points_rules\index.vue
-->
<template>
 <el-card class="page_card" shadow="never">
    
    <template #header>
      <div class="card-header">
        <div class="left">
          设置积分规则
        </div>
        <div class="right">
          
        </div>
      </div>
    </template>
    <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="100px" style="width: 500px;" status-icon>
      <el-form-item label="充值金额" prop="price">
        <el-input  v-model="ruleForm.price" placeholder="请输入" />
      </el-form-item>
      <el-form-item label="获得积分" prop="points">
        <el-input  v-model="ruleForm.points" placeholder="请输入" />
      </el-form-item>
      <el-form-item style="margin-top: 40px;">
        <!-- 保存 取消 -->
         <el-button type="primary" @click="submit(ruleFormRef)">保存</el-button>
         <el-button @click="handlecancelCloses(ruleFormRef)">取消</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ElMessage, FormInstance } from 'element-plus'
 const ruleFormRef = ref<FormInstance>()
  const ruleForm = ref({
    points:'',
    price:''
  })
  const rules = ref({
    points:{
      required:true,
      message:'请输入积分',
      trigger:'blur'
    },
    price:{
      required:true,
      message:'请输入金额',
      trigger:'blur'
    } 
  })
const handlecancelCloses = (formEl: FormInstance | undefined) => {
  if (!formEl) return
  formEl.resetFields()
}
const submit = async (formEl: FormInstance | undefined) => {
  if (!formEl) return
  await formEl.validate((valid, fields) => {
    if (valid) {
     
    }
  })
}
</script>